<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<jsp:useBean id="user" class="model.User" scope="session" />
<jsp:useBean id="prevoznik" class="model.Prevoznik" scope="session" />
<jsp:useBean id="aliases" class="java.lang.String" scope="session" />
<jsp:useBean id="username" class="java.lang.String" scope="request" />
<jsp:useBean id="password" class="java.lang.String" scope="request" />


<html>
<head>
<title>Izmena podataka prevoznika</title>
</head>
<body>
<h1>Izmena podataka prevoznika</h1>

<%
	if (user != null && user.isLoggedIn() || !user.isAdmin()) {
%>
<form action="/admin" method="get">
<table>

	<tr>
		<td align=right>username:</td>
		<td><input type="text" name="username" value="${username}"></td>
	</tr>
	<!-- 
	<tr>
		<td>&nbsp;</td>
		<td><small>voditi brigu o username</small></td>
	</tr> 
	-->

	<tr>
		<td align=right>password:</td>
		<td><input type="text" name="password" value="${password}"></td>
	</tr>
	
	<tr>
		<td align=right>Naziv:</td>
		<td><input type="text" name="naziv" value="${prevoznik.naziv}"></td>		
	</tr>
	
	<tr>
		<td align=right>Aliases:</td>
		<td><textarea name="aliases">${aliases}</textarea></td>		
	</tr>

	<tr>
		<td align=right>Adresa:</td>
		<td><input type="text" name="adresa" value="${prevoznik.adresa}"></td>
	</tr>

	<tr>
		<td align=right>Email:</td>
		<td><input type="text" name="eMail" value="${prevoznik.eMail}"></td>		
	</tr>

	<tr>
		<td align=right>Telefon:</td>
		<td><input type="text" name="telefon" value="${prevoznik.telefon}"></td>
	</tr>

	<tr>
		<td><input type="hidden" name="changedCarrier" value="true">
		<input type="hidden" name="ID" value="${prevoznik.sifra.id}"></td>
		<td><input type="submit" value="Izmeni"></td>
	</tr>
</table>

</form>
<%
	} else {
%>
<p>Niste se prijavili! <br>
<a href="/logIn">Prijavi se</a></p>
<%
	}
%>

<p><a href="/admin">Red voznje</a> <br>
<a href="/logIn?logOff=true">Odjava</a></p>

</body>
</html>
